import service from './index'
//登陆
export default function login(data:any){
  return  service({
    url: "/user/login",
    method: "POST",
    data
  })
}
// 个人信息获取
export function info(account:string,schoolYear:string){
  return  service({
    url: "/records/account"+`?account=${account}&&`+`schoolYear=${schoolYear}`,
    method: "get",
  })
}
//文件上传
export function fileUp(data:any){
  return service({
    url:"/records/import",
    method:"POST",
    // headers:{"Content-Type":"multipart/form-data"},
    data
  })
}
//修改密码
export function SetPassword(data:any){
  return service({
    url:"/user/reset",
    method:"POST",
    data
  })
}
interface scoreInfoType {
  account: any;
  cls: string;
  college: string;
  fiftyRun?: number;
  fiftyRunLevel?: string;
  fiftyRunScore?: number;
  height?: number;
  heightAndWeightLevel?: string;
  heightAndWeightScore?: string;
  id?: number;
  name: string;
  pullUpOrOneMinuteSitUps?: number;
  pullUpOrOneMinuteSitUpsLevel?: string;
  pullUpOrOneMinuteSitUpsScore?: number;
  sex: string;
  sittingForwardFlexion?: number;
  sittingForwardFlexionLevel?: string;
  sittingForwardFlexionScore?: number;
  standingLongJump?: number;
  standingLongJumpLevel?: string;
  standingLongJumpScore?: number;
  thousandRun?: string;
  thousandRunLevel?: string;
  thousandRunScore?: number;
  totalTestLevel?: string;
  totalTestScore?: number;
  vitalCapacity?: number;
  vitalCapacityBodyMassScore?: number;
  vitalCapacityWeightLevel?: string;
  weight?: number;
}
//新增用户信息
export function addUserScore(data:any){
  return service({
    url:"/records/save",
    method:"POST",
    //  headers:{"Content-Type":"application/json"},
    data
  })
}
//查找全部
export function findAllScore(data:any){
  return service({
    url:"/records",
    method:"POST",
    //  headers:{"Content-Type":"application/json"},
    data
  })
}
//根据学号删除
export function delScoreInfo(data:any){
  return service({
    url:"/records/del",
    method:"delete",
    //  headers:{"Content-Type":"application/json"},
    data
  })
}
//导出功能
export function downInfo(schoolYear:any){
  return service({
    url:"/records/export"+`?schoolYear=${schoolYear}`,
    method:"get",
    //  headers:{"Content-Type":"application/json"},
  })
}
//重置密码
export function adminrestPassword(data:any){
  return service({
    url:"/user/adminReset",
    method:"post",
    data
  })
}


   